Skip to content

DSP-24890 Adds OIDC support #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

DSP-24890 Adds OIDC support #20

wants to merge 5 commits into from

Conversation

tiagomlalves
Copy link
Member

@tiagomlalves tiagomlalves commented Jul 10, 2025

Adds OIDC support when connecting to DSE/HCD databases.

@tiagomlalves tiagomlalves changed the title DSP-24890 DSP-24890 Adds OIDC support Jul 13, 2025
@tiagomlalves tiagomlalves requested a review from Copilot July 13, 2025 18:43
@tiagomlalves tiagomlalves marked this pull request as ready for review July 13, 2025 18:43
Copilot

This comment was marked as outdated.

@datastax datastax deleted a comment from Copilot AI Jul 13, 2025
@datastax datastax deleted a comment from Copilot AI Jul 13, 2025
@tiagomlalves tiagomlalves requested a review from Copilot July 14, 2025 09:27
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds OpenID Connect (OIDC) authentication support when connecting to DSE/HCD databases.

  • Upgrades project Java version from 8 to 11 and removes deprecated Animal Sniffer plugin blocks.
  • Introduces new OIDC configuration options and wiring in both the config class and lifecycle manager.
  • Adds the db-advanced-auth-client-plugin dependency to all relevant modules.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
text/pom.xml Removed Animal Sniffer plugin configuration
pom.xml Bumped Java version to 11; added new auth plugin
common/src/.../LifeCycleManager.java Added OIDC provider branch to processAuthenticatorConfig
common/src/.../AuthenticatorConfig.java Defined new OIDC config options and validation
common/pom.xml Declared db-advanced-auth-client-plugin dependency
Comments suppressed due to low confidence (3)

common/src/main/java/com/datastax/oss/common/sink/config/AuthenticatorConfig.java:97

  • The new OIDC options are not yet documented in the project's README or user guide. It would help users if you add examples and descriptions for auth.oidc.* settings in external documentation.
              "OIDC Authentication server url")

common/src/main/java/com/datastax/oss/common/sink/state/LifeCycleManager.java:625

  • The new OIDC code path isn't covered by existing unit or integration tests. Please add tests for OIDCClientCredentialsAuthProvider configuration and error scenarios.
    } else if (authConfig.getProvider() == AuthenticatorConfig.Provider.OIDC) {

common/src/main/java/com/datastax/oss/common/sink/config/AuthenticatorConfig.java:44

  • It looks like SERVICE_OPT was accidentally renamed to auth.gssapi.cservice, which will break existing GSSAPI configurations. Please revert it to auth.gssapi.service.
  public static final String SERVICE_OPT = "auth.gssapi.cservice";

@@ -69,6 +69,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.datastax.db</groupId>
<artifactId>db-advanced-auth-client-plugin</artifactId>
Copy link
Preview

Copilot AI Jul 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new db-advanced-auth-client-plugin dependency is missing a <version> declaration, which may cause build failures. Please add the appropriate ${datastax.advanced-auth-client-plugin.version} or explicit version.

Suggested change
<artifactId>db-advanced-auth-client-plugin</artifactId>
<artifactId>db-advanced-auth-client-plugin</artifactId>
<version>${datastax.advanced-auth-client-plugin.version}</version>

Copilot uses AI. Check for mistakes.

Comment on lines +289 to +296
public URI getOIDCIssuer() {
try {
return new URI(getString(OIDC_ISSUER_OPT));
} catch (URISyntaxException e) {
// This should never happen because we validate the URI in the constructor.
return null;
Copy link
Preview

Copilot AI Jul 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Returning null from getOIDCIssuer() can lead to NPEs downstream. Consider throwing an unchecked exception or using Optional<URI> to clearly signal failure.

Suggested change
public URI getOIDCIssuer() {
try {
return new URI(getString(OIDC_ISSUER_OPT));
} catch (URISyntaxException e) {
// This should never happen because we validate the URI in the constructor.
return null;
public Optional<URI> getOIDCIssuer() {
try {
return Optional.of(new URI(getString(OIDC_ISSUER_OPT)));
} catch (URISyntaxException e) {
// This should never happen because we validate the URI in the constructor.
return Optional.empty();

Copilot uses AI. Check for mistakes.

dlg99 and others added 5 commits July 15, 2025 11:00
Adds OIDC configuration options to connect to DSE/HCD.

This patch enables the following settings in sink-config.json file:
 * setting "auth.provider": "OIDC" enabling the usage of Java Driver
   Plugin auth provider implement Client Credentials Flow
 * setting "auth.oidc.*" settings with required parameters such as
   "issuer", "client_id", "client_secret", etc.

Logic to enable the OIDC auth provider will be done in the following
commit.
Adds DataStax Advanced Auth Client Plugin with OIDC support.
Updates project to JDK 11 (currently minimum requirement for the Auth
Client Plugin) and removes checks for JDK 8.
Updates Jenkins runner as the bionic image is no longer configured
causing the job to get stuck.
Sets JDK 11 as the default java version for building and running tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants